home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 015a / pwr14k.zip / DEMO2.PWR < prev    next >
Text File  |  1991-05-08  |  17KB  |  432 lines

  1. Variable        Fore,1                 ;save areas for initial colors
  2. Variable        Back,1
  3. Variable        ColorAttr,1
  4. Variable        Prn,3
  5. Variable        CharIn,1             ;for user responses
  6. Variable        FnKey,1
  7. Variable        RedOnGray,3,116
  8. Variable        RedOnBlack,3,4
  9. Variable        YelOnBlue,3,30
  10. Variable        YelOnGray,3,126
  11. Variable        BlueOnGray,3,113
  12. Variable        F1,1,#59            ;key value for F1
  13. Variable        ID,4
  14. Variable        MainTitle,36,'126PowerBatch 116Functions'
  15. Variable        M1L1,34,'116Get 126S116ystem Information'
  16. Variable        M1L2,22,'116Draw 126B116oxes'
  17. Variable        M1L3,35,'116Get Input From 126K116eyboard'
  18. Variable        M1L4,28,'116St126R116ing Functions'
  19. Variable        M1L5,25,'116Screen 126W116rites'
  20. Variable        M1L6,21,'126M116iscellaneous'
  21. Variable        M2L1,25,'116Current 126C116olor'
  22. Variable        M2L2,29,'116Current 126D116irectory'
  23. Variable        M2L3,24,'116Current Da126T116e'
  24. Variable        M2L4,21,'116Disk126S116pace'
  25. Variable        M2L5,29,'126E116nvironment Variables'
  26. Variable        M2L6,24,'116Current Ti126M116e'
  27. Variable        Msg,78
  28. Variable        EscMsg,13,' Esc To Quit '
  29. Variable        ContMsg,25,'Press Any Key To Continue'
  30. Variable        ColorMsg1,78,'PowerBatch will supply you with the current foreground, background, and'
  31. Variable        ColorMsg2,78,'composite color by issuing the command ?COLOR. This message is displayed'
  32. Variable        ColorMsg3,78,'using the color attributes active when DEMO2 was started.'
  33. Variable        DOW,9                ;for date command
  34. Variable        Mo,2
  35. Variable        Da,2
  36. Variable        Yr,4
  37. Variable        CurrTime,11          ;for current time
  38. Variable        DriveLtr,1
  39. Variable        DirName,78           ;for user entered directory name
  40. Variable        FileName,78          ;for user entered file name
  41. Variable        Space35,35,"                                   "
  42. Variable        Space76,76,"                                                                            "
  43. Variable        TotSpace,10
  44. Variable        AvailSpace,10
  45. Variable        Msg2,78
  46. Variable        FName,35
  47. Variable        LName,35
  48. ?Color          Fore,Back,ColorAttr  ;initial color
  49. ?Date           DOW,Mo,Da,Yr         ;get system date
  50. ?Time           CurrTime             ;get system time
  51. Clear
  52. ReadYN          "Do you have a color monitor? [Y/N] ",CharIn
  53. Compare         CharIn,"Y",,,ColorMon
  54. Label           ColorMon
  55. Clear            YelOnGray            ;clear to my color
  56. Box4            25,2,51,16,116
  57. WriteAt         28,2,MainTitle
  58. WriteAt         27,4,M1L1
  59. WriteAt         27,6,M1L2
  60. WriteAt         27,8,M1L3
  61. WriteAt         27,10,M1L4
  62. WriteAt         27,12,M1L5
  63. WriteAt         27,14,M1L6
  64. WriteAt         33,16,EscMsg
  65. Label            GetM1
  66. GoToXY            39,15
  67. Write            ' '
  68. GoToXY            39,15
  69. ReadUpKey        CharIn
  70. Compare         CharIn,'',,,Finis
  71. Compare         CharIn,'S',,,SysInfo
  72. Compare         CharIn,'B',,,BoxInfo
  73. Compare         CharIn,'K',,,KeyBdInfo
  74. Compare         CharIn,'R',,,StrInfo
  75. Compare         CharIn,'W',,,WritInfo
  76. Compare         CharIn,'M',,,MiscInfo
  77. Beep            800,1
  78. Beep            300,2
  79. GoTo            GetM1
  80. Label        SysInfo
  81. Box4            40,4,64,18,116
  82. Color            RedOnGray
  83. WriteAt         43,4,'System Information'
  84. WriteAt         42,6,M2L1
  85. WriteAt         42,8,M2L2
  86. WriteAt         42,10,M2L3
  87. WriteAt         42,12,M2L4
  88. WriteAt         42,14,M2L5
  89. WriteAt         42,16,M2L6
  90. WriteAt         48,18,EscMsg
  91. Label        GetM2
  92. GoToXY            52,17
  93. Write            ' '
  94. GoToXy            52,17
  95. ReadUpKey        CharIn
  96. Compare         CharIn,'',,,ColorMon
  97. Compare         CharIn,'C',,,ColorInfo
  98. Compare         CharIn,'D',,,DirInfo
  99. Compare         CharIn,'T',,,DateInfo
  100. Compare         CharIn,'S',,,SpaceInfo
  101. Compare         CharIn,'E',,,EnvirInfo
  102. Compare         CharIn,'M',,,TimeInfo
  103. Beep            800,1
  104. Beep            300,2
  105. GoTo            GetM2
  106. Label       ColorInfo
  107. WriteAt         2,20,ColorMsg1,ColorAttr
  108. WriteAt         2,21,ColorMsg2,ColorAttr
  109. WriteAt         2,22,ColorMsg3,ColorAttr
  110. GoTo        M2Cont
  111. Label        DirInfo
  112. SetVar            DriveLtr,'A'
  113. ?CurrDir        DriveLtr,DirName
  114. Concat            Msg,'Drive A current directory is ',DirName
  115. WriteAt         2,20,Msg
  116. Label        DrC
  117. SetVar            DriveLtr,'C'
  118. ?DriveExist     DriveLtr,DrCOK
  119. WriteAt         2,21,'No drive C defined in your system.'
  120. GoTo            M2Cont
  121. Label        DrCOK
  122. ?CurrDir        DriveLtr,DirName
  123. Concat            Msg,'Drive C current directory is ',DirName
  124. WriteAt         2,21,Msg
  125. SetVar            DriveLtr,'D'
  126. ?DriveExist     DriveLtr,DrDOK
  127. WriteAt         2,22,'No drive D defined in your system.'
  128. GoTo            M2Cont
  129. Label        DrDOK
  130. ?CurrDir        DriveLtr,DirName
  131. Concat            Msg,'Drive D current directory is ',DirName
  132. WriteAt         2,22,Msg
  133. GoTo            M2Cont
  134. Label        DateInfo
  135. Concat            Msg,'Today is ',DOW
  136. Concat            Msg,' '
  137. Concat            Msg,Mo
  138. Concat            Msg,'/'
  139. Concat            Msg,Da
  140. Concat            Msg,'/'
  141. Concat            Msg,Yr
  142. WriteAt         2,20,Msg
  143. GoTo            M2Cont
  144. Label        SpaceInfo
  145. WriteAt         2,20,'Enter drive letter '
  146. ReadUpKey        DriveLtr
  147. ?DriveExist     DriveLtr,ValidDr
  148. WriteAt         2,20,'Invalid Drive !!!  '
  149. GoTo            GetM2
  150. Label            ValidDr
  151. ?DiskSpace        DriveLtr,TotSpace,AvailSpace
  152. Compare         TotSpace,0,,DrNotRdy,DrNotRdy
  153. Concat            Msg,'Drive ',DriveLtr
  154. Concat            Msg,' has a capacity of '
  155. Concat            Msg,TotSpace
  156. Concat            Msg,' bytes. The disk has '
  157. Concat            Msg,AvailSpace
  158. Concat            Msg,' bytes free.'
  159. WriteAt         2,20,Msg
  160. GoTo            M2Cont
  161. Label        DrNotRdy
  162. WriteAt         2,20,'Drive not ready !!!'
  163. GoTo            M2Cont
  164. Label        EnvirInfo
  165. ?EnvStr         'PATH',DirName
  166. Concat            Msg,'Current path is ',DirName
  167. WriteAt         2,20,Msg
  168. ?EnvStr         'PROMPT',DirName
  169. Concat            Msg,'Your prompt command is ',DirName
  170. WriteAt         2,21,Msg
  171. ?EnvStr         'COMSPEC',DirName
  172. Concat            Msg,'Your command processor is ',DirName
  173. WriteAt         2,22,Msg
  174. GoTo            M2Cont
  175. Label        TimeInfo
  176. Concat            Msg,'Your system time is currently ',CurrTime
  177. WriteAt         2,20,Msg
  178. GoTo            M2Cont
  179. Label      M2Cont
  180. WriteAt         27,23,ContMsg,RedOnGray
  181. ReadKey         CharIn
  182. ClearBox        1,19,78,24,YelOnGray
  183. GoTo            GetM2
  184. Label       BoxInfo
  185. Clear
  186. Box1            10,2,55,15,116
  187. WriteAt         12,4,'PowerBatch draws four types of boxes...'
  188. WriteAt         14,6,'A single line border'
  189. Wait            50
  190. Box2            10,2,55,15,116
  191. WriteAt         12,4,'PowerBatch draws four types of boxes...'
  192. WriteAt         14,6,'A double line border'
  193. Wait            30
  194. Box3            10,2,55,15,116
  195. WriteAt         12,4,'PowerBatch draws four types of boxes...'
  196. WriteAt         14,6,'A solid line border'
  197. Wait            30
  198. Box4            10,2,55,15,116
  199. WriteAt         12,4,'PowerBatch draws four types of boxes...'
  200. WriteAt         14,6,'A single line border with a shadow'
  201. Wait            30
  202. WriteAt         14,8,'You can clear the contents of a box'
  203. WriteAt         14,9,'without redrawing the box or clearing'
  204. WriteAt         14,10,'the screen...'
  205. Wait            50
  206. ClearBox        10,2,55,15,116
  207. WriteAt         12,4,'Boxes can be drawn so quickly they can'
  208. WriteAt         12,5,'be made to appear to move.'
  209. Wait            50
  210. ClearBox        9,1,58,16,116
  211. Box1            11,3,56,16,116
  212. ClearBox        10,2,57,17,116
  213. Box1            12,4,57,17,116
  214. ClearBox        11,3,58,18,116
  215. Box1            13,5,58,18,116
  216. ClearBox        12,4,59,19,116
  217. Box1            14,6,59,19,116
  218. ClearBox        13,5,60,20,116
  219. Box1            15,7,60,20,116
  220. ClearBox        14,6,61,21,116
  221. Box1            16,8,61,21,116
  222. ClearBox        15,7,62,22,116
  223. Box4            17,9,62,22,116
  224. WriteAt         19,11,'Boxes can be drawn so quickly they can'
  225. WriteAt         19,12,'be made to appear to move.'
  226. Wait            50
  227. GoTo            ColorMon
  228. Label       KeyBdInfo
  229. Clear
  230. Box1        5,5,75,19,116
  231. WriteAt     7,7,'There are several keyboard read functions in PowerBatch.'
  232. WriteAt     7,8,'You can read a single character (and only one character) from the'
  233. WriteAt     7,9,'keyboard, including all special characters like Alt-F1; you can'
  234. WriteAt     7,10,'read a string of a specified length and not accept any additional'
  235. WriteAt     7,11,'characters; you can read a single key and change the character'
  236. WriteAt     7,12,'to upper case regardless of the case entered; and you can read'
  237. WriteAt     7,13,'a key in response to a (Y)es or (N)o question, forcing the key'
  238. WriteAt     7,14,'to upper case Y or N, and accepting no other characters.'
  239. WriteAt     7,16,'For Example...'
  240. Label        ForceF1
  241. WriteAt     14,17,'Press F1 for Help '
  242. ReadKey     CharIn,FnKey
  243. Compare     FnKey,1,,,SpecKey
  244. Beep        500,3
  245. GoTo        ForceF1
  246. Label        SpecKey
  247. Compare     CharIn,F1,,,GotF1
  248. Beep        500,3
  249. GoTo        ForceF1
  250. Label        GotF1
  251. WriteAt     14,17,'Help is on the way...'
  252. Wait        30
  253. WriteAt     14,17,'Enter Your 4 Digit ID Number And Press Enter '
  254. ReadStr     ID
  255. Wait        20
  256. MidString    Msg,Space76,1,50
  257. WriteAt     14,17,Msg
  258. WriteAt     14,17,'Enter The Drive Letter To Check '
  259. ReadUpKey    CharIn
  260. Wait        20
  261. GoToXY        14,17
  262. ReadYN        'Do you wish to continue with this demo (Y/N) ',CharIn
  263. Wait        30
  264. GoTo        ColorMon
  265. Label        StrInfo
  266. Clear
  267. Box2        1,1,80,11,116            ;for variables
  268. Box1        1,12,39,24,116            ;for compare
  269. Box1        41,12,80,24,116         ;for midstring
  270. Center      ' Variable ',1
  271. WriteAt     15,12,' Compare '
  272. WriteAt     54,12,' MidString '
  273. WriteAt     2,2,'The VARIABLE command is one of the commands which makes PowerBatch unique'
  274. WriteAt     2,3,'among its competitors. You can define variables and constants, give them'
  275. WriteAt     2,4,'an english name, change them, write them, use them as commands, add and'
  276. WriteAt     2,5,'subtract to them, and even use them as parms in a DOS command! There is no'
  277. WriteAt     2,6,'limit to them and they are static, not gradually eating away at your memory.'
  278. WriteAt     2,7,'They are resolved to address locations at compile time and are smart enough'
  279. WriteAt     2,8,'to know if they should be treated as alpha or numeric. You can imbed color'
  280. WriteAt     2,9,'commands in the text definition and give them values you cannot even find a'
  281. WriteAt     2,10,'key for on your keyboard. You can do almost anything to them but abuse them.'
  282.                 ;         1      1    2    2     3      3    4    4     5      5    6    6     7      7    8
  283.                 ;...5....0....5....0....5....0....5....0....5....0....5....0....5....0....5....0
  284. WriteAt     2,14,'The Compare command allows you to'
  285. WriteAt     2,15,'compare two variables, or a variable'
  286. WriteAt     2,16,'and a constant and execute various'
  287. WriteAt     2,17,'parts of your batch program based on'
  288. WriteAt     2,18,'the results. Compare will properly'
  289. WriteAt     2,19,'evaluate 2 compared to 19 (DOS will'
  290. WriteAt     2,20,'not) shifting between numeric and'
  291. WriteAt     2,21,'alphabetic comparisions based on the'
  292. WriteAt     2,22,'contents of the variables being'
  293. WriteAt     2,23,'compared.'
  294. WriteAt     43,14,'The MidString command allows you to'
  295. WriteAt     43,15,'separate variables into smaller'
  296. WriteAt     43,16,'parts as needed. If you enter a'
  297. WriteAt     43,17,'date from the keyboard as mm/dd/yy'
  298. WriteAt     43,18,'you can break it apart into the 3'
  299. WriteAt     43,19,'components with the MidString'
  300. WriteAt     43,20,'command.'
  301. Center        'Press Any Key To Continue',25
  302. ReadKey     CharIn
  303. Clear
  304. Box1        1,1,39,11,116
  305. WriteAt     16,1,' Concat '
  306. Box1        41,1,80,11,116
  307. WriteAt     56,1,' Length '
  308. Box1        1,13,39,24,116
  309. WriteAt     16,13,' Lower '
  310. Box1        41,13,80,24,116
  311. WriteAt     56,13,' Upper '
  312.                 ;         1      1    2    2     3      3    4    4     5      5    6    6     7      7    8
  313.                 ;...5....0....5....0....5....0....5....0....5....0....5....0....5....0....5....0
  314. WriteAt     2,3,'The Concat command is used to combine'
  315. WriteAt     2,4,'two variables (or combinations of'
  316. WriteAt     2,5,'variables and constants) into one'
  317. WriteAt     2,6,'variable.'
  318. WriteAt     2,7,'  Concat Msg,DrIn,ErrMsg6'
  319. WriteAt     2,8,'would combine the contents of DrIn'
  320. WriteAt     2,9,'and ErrMsg6 into the variable Msg.'
  321. WriteAt     42,3,'The Length command will calculate'
  322. WriteAt     42,4,'the length of any variable. This'
  323. WriteAt     42,5,'length is valuable when using the'
  324. WriteAt     43,6,'MidString command.'
  325.                 ;         1      1    2    2     3      3    4    4     5      5    6    6     7      7    8
  326.                 ;...5....0....5....0....5....0....5....0....5....0....5....0....5....0....5....0
  327. WriteAt     2,14,'The Lower command will change any'
  328. WriteAt     2,15,'upper case characters to lower'
  329. WriteAt     2,16,'case. Any characters which are not'
  330. WriteAt     2,17,'alphabetic characters will remain'
  331. WriteAt     2,18,'unchanged.'
  332. WriteAt     42,14,'The Upper command will change any'
  333. WriteAt     42,15,'lower case characters to upper'
  334. WriteAt     42,16,'case. Any characters which are not'
  335. WriteAt     42,17,'alphabetic characters will remain'
  336. WriteAt     42,18,'unchanged.'
  337. Center        'Press Any Key To Continue',25
  338. ReadKey     CharIn
  339. GoTo        ColorMon
  340. Label       WritInfo
  341. Box2        5,5,76,20,116
  342. WriteAt     7,7,'PowerBatch contains a number of screen writing commands, all designed'
  343. WriteAt     7,8,'to get the information to the screen as quickly as possible. One of'
  344. WriteAt     7,9,'the major deficiencies of the DOS batch file is the slow screen write'
  345. WriteAt     7,10,'functions associated with DOS. To get a feel for the speed at which'
  346. WriteAt     7,11,'PowerBatch writes to the screen, press any key to redisplay this'
  347. WriteAt     7,12,'entire screen. I will clear the screen, draw the box, center the'
  348. WriteAt     7,13,'title, and rewrite all the text. Ready when you are...'
  349. ReadKey     CharIn
  350. Clear
  351. Box2        5,5,76,20,116
  352. Center        ' PowerBatch Screen Write Functions ',5
  353. WriteAt     7,7,'PowerBatch contains a number of screen writing commands, all designed'
  354. WriteAt     7,8,'to get the information to the screen as quickly as possible. One of'
  355. WriteAt     7,9,'the major deficiencies of the DOS batch file is the slow screen write'
  356. WriteAt     7,10,'functions associated with DOS. To get a feel for the speed at which'
  357. WriteAt     7,11,'PowerBatch writes to the screen, press any key to redisplay this'
  358. WriteAt     7,12,'entire screen. I will clear the screen, draw the box, center the'
  359. WriteAt     7,13,'title, and rewrite all the text. Were you impressed...'
  360. Wait        50
  361. ClearBox    5,5,76,20,116
  362. WriteAt     7,7,'PowerBatch provides 4 screen writing commands: 1) WriteAT, 2) Write,'
  363. WriteAt     7,8,'3) WriteLine, and 4) Center. Lets look at the differences in these'
  364. WriteAt     7,9,'commands. Center is the most obvious. If you want to center a line'
  365. WriteAt     7,10,'of text, use this command. It was used to center the title on this'
  366. WriteAt     7,11,'box and the message at the bottom.'
  367. Center        ' Press Any Key To Continue ',20
  368. ReadKey     CharIn
  369. ClearBox    5,5,76,20,116
  370. WriteAt     7,7,'WriteAt has the syntax'
  371. WriteAt     12,8,'WriteAT  Col,Row,Text To Be Written'
  372. WriteAt     7,9,'It allows you to position text anywhere on the screen with direct'
  373. WriteAt     7,10,'screen co-ordinates.'
  374. WriteAt     7,12,'Write has the syntax'
  375. WriteAt     12,13,'Write  Text To Be Written'
  376. WriteAt     7,14,'Text is written beginning with the current cursor location. It can'
  377. WriteAt     7,15,'be thought of as on screen concatenation.'
  378. WriteAt     7,17,'WriteLine has the syntax'
  379. WriteAt     12,18,'WriteLine  Row,Text To Be Written'
  380. WriteAt     7,19,'The text is written on the specified Row beginning in column 1.'
  381. ReadKey     CharIn
  382. GoTo        ColorMon
  383. Label       MiscInfo
  384. Box2        1,1,80,25,116
  385. Center        ' Miscellaneous Functions ',1
  386. Center        EscMsg,25
  387.                 ;        1     1      2    2    3     3      4    4    5     5      6    6    7     7      8
  388.                 ;..5....0....5....0....5....0....5....0....5....0....5....0....5....0....5....0
  389. WriteAt     3,3,'ADD       Provides the ability to increment a counter. Useful for looping'
  390. WriteAT     3,4,'           through a routine X times as well as arithmatic.'
  391. WriteAT     3,5,'BEEP      Complete control over the system speaker. Sound the speaker at a'
  392. WriteAT     3,6,'           specified frequency for any length of time and repeat N times.'
  393. WriteAT     3,7,'BLINK     Will cause all following write statements to be written with the'
  394. WriteAT     3,8,'           current color attribute but with the'
  395. Blink
  396. WriteAT     51,8,'blink'
  397. Normal
  398. WriteAT     57,8,'bit on. NORMAL resets.'
  399.                 ;        1     1      2    2    3     3      4    4    5     5      6    6    7     7      8
  400.                 ;..5....0....5....0....5....0....5....0....5....0....5....0....5....0....5....0
  401. WriteAT     3,9,'CENTER    Used to center text on the screen. The title of this screen was'
  402. WriteAT     3,10,'          centered after the box was drawn.'
  403. WriteAt     3,11,'CONCAT    Provides a means to combine two text strings into one. Use this'
  404. WriteAT     3,12,'           command to build messages prior to writing to the screen.'
  405. WriteAt     20,13,'Variable  Err1,25, is an invalid drive!'
  406. WriteAt     20,14,'Concat    Msg1, DriveInput, Err1'
  407. WriteAt     20,15,'WriteAt   2,25,Msg1'
  408. WriteAt     3,16,'LENGTH    Calculates the length of a string. Use in conjunction with the'
  409. WriteAt     3,17,'           MIDSTRING command or for editing of input data.'
  410. WriteAt     3,18,'LOWER     Changes all alphabetic characters in a string to lower case without'
  411. WriteAt     3,19,'           having any effect on non-alphabetic characters in the string.'
  412. WriteAt     3,20,'REVERSE   Will cause all write statements that follow to be written in'
  413. Reverse
  414. WriteAt     14,21,'reverse'
  415. Normal
  416. WriteAt     22,21,'video. Use NORMAL to reset the color to the prior value.'
  417. WriteAt     3,22,'SUBTRACT  Provides the ability to decrement a counter.'
  418. WriteAt     3,23,'UPPER    Changes all alphabetic characters in a string to upper case without'
  419. WriteAt     3,24,'          having any effect on non-alphabetic characters in the string.'
  420. ReadKey     CharIn
  421. GoTo        ColorMon
  422. Label       Finis
  423. Clear
  424. Color           ColorAttr                       ;reset original colors
  425. Clear
  426. Box3            24,1,56,5,ColorAttr
  427. Center          "POWERBATCH",2
  428. Center          "By",3
  429. Center          "Computing Systems Design, Inc.",4
  430. GoToXy          1,24
  431.  
  432.